<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="description" content=""/>
    <meta name="author" content="" />
    <title>汽车购票系统——我的订单页面</title>
    <link th:href="@{/css/order_index.css}" rel="stylesheet">
    <link th:href="@{/css/reset.css}" rel="stylesheet">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body style="background: #F0F8FF">
<!-- -----头 部----- -->
<header>
    <div class="contain">
        <div class="headlt">
            <a th:href="@{/customer/index}"><img th:src="@{/image/logo.png}"></a>
        </div>
        <div class="headrg">
            <ul>
                <li><a  th:text="${customer.nick_name}">昵称</a>
                    <ul>
                        <li><a th:href="@{/customer/query(id=${customer.id})}">我的信息</a></li>
                        <li><a th:href="@{/order/index(id=${customer.id})}">我的订单</a></li>
                    </ul>
                </li>
                <li><a th:href="@{/publiz/index}">注销</a></li>
            </ul>
        </div>
    </div>
</header>
<div class="contain_order">
    <h2>我的订单</h2>
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>订单号</th>
                <th>出发城市</th>
                <th>到达城市</th>
                <th>车牌</th>
                <th>时间</th>
                <th>位置</th>
                <th>票价</th>
                <th style="width: 210px;"></th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item:${orders}">
                <td th:text="${item.id}">1001</td>
                <td th:text="${item.starting_station}">广州</td>
                <td th:text="${item.destination}">深圳</td>
                <td th:text="${item.pleat_number}">粤A8888</td>
                <td th:text="${item.departure_time}">2018-07-01 12:00</td>
                <td th:text="${item.seat_number}">11</td>
                <td th:text="${item.ticket_price}">50</td>
                <td >
                    <a class="btn btn-primary btn-block" href="#" >改签</a>
                    <a class="btn btn-primary btn-block" href="#" th:onclick="'javascript:test(\''+${item.id}+'\')'">退签</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="back_sign" id="back_sign">
    <form th:action="@{/order/index}" method="post">
        <img th:src="@{/image/logo.png}">
        <h4 style="text-align: center">您确定要退签吗？</h4>
        <!--<input type="hidden" name="customer_id" th:value="${customer.id}"></input>-->
        <input id="id" type="hidden" name="id" value=""></input>
        <button class="btn btn-primary btn-block" type="submit" style="float: left;">确定</button>
        <a id="close" class="btn btn-primary btn-block" href="#" style="float: right;">取消</a>
    </form>
</div>

<!--服务-->
<div class="service">
    <div class="service_con">
        <div class="service01">
            <img th:src="@{/image/fuwu.png}">
            <p>7X24小时服务</p>
        </div>
        <div class="service02">
            <img th:src="@{/image/chupiao.png}">
            <p>第一时间出票</p>
        </div>
        <div class="service03">
            <img th:src="@{/image/zhifu.png}">
            <p>安全支付</p>
        </div>
        <div class="service04">
            <img th:src="@{/image/shouhou.png}">
            <p>无忧售后保障</p>
        </div>
    </div>
</div>
<footer>
    <div class="foot">
        <ul>
            <li><a href="">网站地图</a></li>
            <li><a href="">关于我们</a></li>
            <li><a href="">联系我们</a></li>
        </ul>
        <ul>
            <li><a href="">合作企业</a></li>
            <li><a href="">法律声明</a></li>
            <li><a href="">隐私政策</a></li>
        </ul>
        <ul>
            <li><a href="">帮助中心</a></li>
            <li><a href="">在线提问</a></li>
            <li><a href="">问题反馈</a></li>
        </ul>
        <div class="foot_right">
            <p class="tel">400-488-6666</p>
            <p class="online">在线客服</p>
        </div>
    </div>
    <div class="copyright">&copy;2018-11  CYL版权所有</div>
</footer>
<script>
    function test(id){
        $("#id").attr("value",id);
        back_sign.style.display = 'block';
    }
</script>
<script type="text/javascript">
    window.onload = function(){
        var back_sign = document.getElementById('back_sign');
        var close = document.getElementById('close');
        back_sign.style.width = document.body.clientWidth + 'px';
        back_sign.style.height = window.innerHeight + 'px';
        var trs = document.getElementsByTagName('tr');
        close.onclick = function(){
            back_sign.style.display = 'none';
        }
    }
</script>
</body>
</html>
